/* 1403. 非递增顺序的最小子序列 */
/**
 * @param {number[]} nums
 * @return {number[]}
 */
var minSubsequence = function (nums) {
	const len = nums.length
	if (len === 1) return nums
	nums.sort((a, b) => b - a)
	const total = nums.reduce((prev, next) => prev + next)
	const ans = []
	let curr = 0
	for (let i = 0; i <= len / 2; i++) {
		curr += nums[i]
		ans.push(nums[i])
		if (total - curr < curr) break
	}
	return ans
}
const result = minSubsequence([10, 2, 5])
console.log('result :>>', result)
